package com.jumper.study.admin.dto.resp;

import java.time.LocalDateTime;
import java.time.ZoneOffset;

public class LessonListResp {
    private Long id;

    private String title;

    private Integer categoryId;

    private String categoryTitle;

    private String thumb;

    private String summary;

    private Integer price;

    private Integer marketPrice;

    private Boolean recommend;

    private Boolean onself;

    private String teachers;

    private Integer buyCount;

    private Integer chapterCount;

    private Integer ebookCount;

    private Long sort;

    private LocalDateTime updatedAt;

    public LessonListResp() {
    }

    public LessonListResp(Long id, String title, Integer categoryId, String categoryTitle, String thumb, String summary, Integer price,
            Integer marketPrice, Boolean recommend, Boolean onself, String teachers, Integer buyCount,
            Integer chapterCount, Integer ebookCount, Long sort, LocalDateTime updatedAt) {
        this.id = id;
        this.title = title;
        this.categoryId = categoryId;
        this.categoryTitle = categoryTitle;
        this.thumb = thumb;
        this.summary = summary;
        this.price = price;
        this.marketPrice = marketPrice;
        this.recommend = recommend;
        this.onself = onself;
        this.teachers = teachers;
        this.buyCount = buyCount;
        this.chapterCount = chapterCount;
        this.ebookCount = ebookCount;
        this.sort = sort;
        this.updatedAt = updatedAt;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCategoryTitle() {
        return categoryTitle;
    }

    public void setCategoryTitle(String categoryTitle) {
        this.categoryTitle = categoryTitle;
    }

    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public Integer getPrice() {
        if (price != null) {
            return price / 100;
        }
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getMarketPrice() {
        if (marketPrice != null) {
            return marketPrice / 100;
        }
        return marketPrice;
    }

    public void setMarketPrice(Integer marketPrice) {
        this.marketPrice = marketPrice;
    }

    public Boolean getRecommend() {
        return recommend;
    }

    public void setRecommend(Boolean recommend) {
        this.recommend = recommend;
    }

    public Boolean getOnself() {
        return onself;
    }

    public void setOnself(Boolean onself) {
        this.onself = onself;
    }

    public String getTeachers() {
        return teachers;
    }

    public void setTeachers(String teachers) {
        this.teachers = teachers;
    }

    public Integer getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(Integer buyCount) {
        this.buyCount = buyCount;
    }

    public Integer getChapterCount() {
        return chapterCount;
    }

    public void setChapterCount(Integer chapterCount) {
        this.chapterCount = chapterCount;
    }

    public Integer getEbookCount() {
        return ebookCount;
    }

    public void setEbookCount(Integer ebookCount) {
        this.ebookCount = ebookCount;
    }

    public Long getSort() {
        return sort;
    }

    public void setSort(Long sort) {
        this.sort = sort;
    }

    public Long getUpdatedAt() {
        return updatedAt.toEpochSecond(ZoneOffset.UTC);
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }
}
